﻿using NearAop.Interfaces;
using System;

namespace NearAop
{
    /// <summary>
    /// 设置字段为代理的实例
    /// </summary>
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
    public sealed class SetProxySourceAttribute : Attribute, IAopSetProxySource
    {
        /// <summary>
        /// 使用无参构造函数时，自动启用字段类型作为代理类
        /// </summary>
        public SetProxySourceAttribute() { }

        public SetProxySourceAttribute(params Type[] proxyTypes) => ProxyTypes = proxyTypes;

        public Type[] ProxyTypes { get; } = new Type[] { };
    }
}
